Skip to content

feat: matrix ci - #2014

Merged
Calcium-Ion merged 6 commits into
QuantumNous:mainfrom
seefs001:fix/ci
Oct 11, 2025
Merged

feat: matrix ci#2014
Calcium-Ion merged 6 commits into
QuantumNous:mainfrom
seefs001:fix/ci

Conversation

@seefs001

@seefs001 seefs001 commented Oct 11, 2025

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Native multi-architecture Docker images (amd64 and arm64).
    • Unified multi-arch manifests for seamless pulls across platforms.
    • Images published to both Docker Hub and GitHub Container Registry.
    • Expanded tagging: versioned, latest, and alpha variants.
  • Chores

    • CI workflows restructured to streamline builds, tagging, and publishing across registries and architectures.

@coderabbitai

coderabbitai Bot commented Oct 11, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Two GitHub Actions workflows were restructured to use a two-job pattern: per-architecture native builds (amd64, arm64) followed by multi-arch manifest creation for Docker Hub and GHCR. The Dockerfile was updated to support cross-architecture builds via TARGETOS/TARGETARCH with explicit GOOS/GOARCH defaults and separated ENV settings.

Changes

Cohort / File(s) Summary of changes
CI: Multi-arch native builds + manifests
.github/workflows/docker-image-alpha.yml, .github/workflows/docker-image-arm64.yml
Replaced single job with two jobs: build_single_arch (matrix: amd64/arm64, native runners) and create_manifests (depends on build, runs on tags). Added shallow checkout, tag/version resolution, GHCR repository normalization, explicit logins, docker/build-push-action v6, per-arch tags, pushes to Docker Hub and GHCR, and imagetools manifests for versioned/alpha/latest across both registries.
Dockerfile: Cross-arch args/env
Dockerfile
Added ARG TARGETOS/TARGETARCH; set GOOS/GOARCH from these with defaults (linux/amd64). Split ENV to include GO111MODULE=on and CGO_ENABLED=0 separately. Enables explicit cross-arch builds.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Developer
  participant GA as GitHub Actions
  participant BldA as build_single_arch (amd64)
  participant BldR as build_single_arch (arm64)
  participant Hub as Docker Hub
  participant GHCR as GHCR
  participant Man as create_manifests

  Dev->>GA: Push tag (refs/tags/...)
  GA->>BldA: Start native build (linux/amd64)
  GA->>BldR: Start native build (linux/arm64)

  rect rgba(200,230,255,0.3)
    note right of BldA: Shallow checkout, tag/version resolve,<br/>normalize GHCR repo, metadata
    BldA->>Hub: Push image (amd64 tags)
    BldA->>GHCR: Push image (amd64 tags)
  end

  rect rgba(200,230,255,0.3)
    note right of BldR: Shallow checkout, tag/version resolve,<br/>normalize GHCR repo, metadata
    BldR->>Hub: Push image (arm64 tags)
    BldR->>GHCR: Push image (arm64 tags)
  end

  GA-->>Man: needs: build_single_arch (both arch builds complete)

  alt Tag build (refs/tags/*)
    Man->>Hub: Create/push multi-arch manifests<br/>(versioned, latest/alpha)
    Man->>GHCR: Create/push multi-arch manifests<br/>(versioned, latest/alpha)
  else Non-tag
    note over Man: Skipped by workflow condition
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

I hopped through YAML fields so wide,
Two jobs now dance in parallel stride.
AMD hops left, ARM skips right—
Manifests weave in tag-lit night.
Docker winds hum, GHCR beams—
Carrots for builds, and shipping dreams. 🥕🚀

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The title “feat: matrix ci” is overly generic and does not clearly convey the specific change to add a multi-arch Docker build matrix and manifest creation workflow; it lacks context on what is being matrix-driven and where the feature applies. Consider renaming the pull request to explicitly reference the addition of a multi-architecture Docker build matrix and manifest creation steps, for example “feat(ci): add multi-arch Docker build matrix and manifests”.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6592098 and 514a44f.

📒 Files selected for processing (3)
  • .github/workflows/docker-image-alpha.yml (1 hunks)
  • .github/workflows/docker-image-arm64.yml (2 hunks)
  • Dockerfile (1 hunks)

Comment on lines +122 to +134
- name: Create & push manifest (GHCR - version)
run: |
docker buildx imagetools create \
-t ghcr.io/${GHCR_REPOSITORY}:${TAG} \
ghcr.io/${GHCR_REPOSITORY}:${TAG}-amd64 \
ghcr.io/${GHCR_REPOSITORY}:${TAG}-arm64

- name: Create & push manifest (GHCR - latest)
run: |
docker buildx imagetools create \
-t ghcr.io/${GHCR_REPOSITORY}:latest \
ghcr.io/${GHCR_REPOSITORY}:latest-amd64 \
ghcr.io/${GHCR_REPOSITORY}:latest-arm64

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Define GHCR_REPOSITORY before creating manifests.

create_manifests runs in a fresh job, so GHCR_REPOSITORY is empty here. As a result, commands like docker buildx imagetools create -t ghcr.io/${GHCR_REPOSITORY}:${TAG} expand to ghcr.io/:${TAG}, which fails and stops the release. Recompute the repository name in this job before the GHCR steps.

   create_manifests:
     name: Create multi-arch manifests (Docker Hub + GHCR)
     needs: [build_single_arch]
     runs-on: ubuntu-latest
     if: startsWith(github.ref, 'refs/tags/')
     steps:
       - name: Extract tag
         run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
+
+      - name: Normalize GHCR repository
+        run: echo "GHCR_REPOSITORY=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Create & push manifest (GHCR - version)
run: |
docker buildx imagetools create \
-t ghcr.io/${GHCR_REPOSITORY}:${TAG} \
ghcr.io/${GHCR_REPOSITORY}:${TAG}-amd64 \
ghcr.io/${GHCR_REPOSITORY}:${TAG}-arm64
- name: Create & push manifest (GHCR - latest)
run: |
docker buildx imagetools create \
-t ghcr.io/${GHCR_REPOSITORY}:latest \
ghcr.io/${GHCR_REPOSITORY}:latest-amd64 \
ghcr.io/${GHCR_REPOSITORY}:latest-arm64
create_manifests:
name: Create multi-arch manifests (Docker Hub + GHCR)
needs: [build_single_arch]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Extract tag
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Normalize GHCR repository
run: echo "GHCR_REPOSITORY=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
- name: Create & push manifest (GHCR - version)
run: |
docker buildx imagetools create \
-t ghcr.io/${GHCR_REPOSITORY}:${TAG} \
ghcr.io/${GHCR_REPOSITORY}:${TAG}-amd64 \
ghcr.io/${GHCR_REPOSITORY}:${TAG}-arm64
- name: Create & push manifest (GHCR - latest)
run: |
docker buildx imagetools create \
-t ghcr.io/${GHCR_REPOSITORY}:latest \
ghcr.io/${GHCR_REPOSITORY}:latest-amd64 \
ghcr.io/${GHCR_REPOSITORY}:latest-arm64

@Calcium-Ion
Calcium-Ion merged commit 55afd5c into QuantumNous:main Oct 11, 2025
1 check passed
This was referenced Oct 11, 2025
Sacode pushed a commit to Sacode/new-api that referenced this pull request Oct 11, 2025
This was referenced Oct 12, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Dec 25, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Jan 25, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Feb 21, 2026
Closed
ennnnny pushed a commit to ennnnny/new-api that referenced this pull request Mar 17, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Mar 24, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Apr 5, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Jun 16, 2026
11 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Jul 10, 2026
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants